package com.wuzheng.wisgo.sanitation.cloud.repository.mapper.facility;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.wuzheng.wisgo.sanitation.cloud.model.facility.pojo.FacilityDTO;
import com.wuzheng.wisgo.sanitation.cloud.model.facility.pojo.TrashStateDTO;
import com.wuzheng.wisgo.sanitation.cloud.repository.builder.facility.FacilityBuilder;
import com.wuzheng.wisgo.sanitation.cloud.repository.entity.facility.Facility;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * <p>
 * 环卫设施信息 Mapper 接口
 * </p>
 *
 * @author hoipang
 * @since 2019-12-03
 */
public interface FacilityMapper extends BaseMapper<Facility> {

    /**
     * 查询环卫设施特定信息分页列表
     * @param page
     * @param name
     * @param code
     * @return
     */
    @SelectProvider(type = FacilityBuilder.class, method = "buildListFacilityDTOsSql")
    List<FacilityDTO> pageFacilityDTOs(Page page, @Param("id") String id, @Param("name") String name, @Param("code") String code);

    /**
     * 查询环卫设施特定信息列表
     * @param name
     * @param code
     * @return
     */
    @SelectProvider(type = FacilityBuilder.class, method = "buildListFacilityDTOsSql")
    List<FacilityDTO> listFacilityDTOs(@Param("id") String id, @Param("name") String name, @Param("code") String code);

    /**
     * 查询地图上所有环卫设施分配状态
     * @return
     */
    @SelectProvider(type = FacilityBuilder.class, method = "buildListTrashDistributionStateDTOsSql")
    List<TrashStateDTO> listTrashDistributionStateDTOs();

    /**
     * 查询地图上所有环卫设施收运状态
     * @return
     */
    @SelectProvider(type = FacilityBuilder.class, method = "buildListTrashClearStateDTOsSql")
    List<TrashStateDTO> listTrashClearStateDTOs();

    /**
     * 查询环卫设施详情
     * @param id
     * @return
     */
    @SelectProvider(type = FacilityBuilder.class, method = "buildListFacilityDTOsSql")
    FacilityDTO selectFacilityDTO(@Param("id") String id, @Param("name") String name, @Param("code") String code);
}
